﻿@model Apps.Models.Sys.SysModuleModel
@using Apps.Common;
@using Apps.Models.Sys;
@using Apps.Web.Core;
@using Apps.Locale;
@{
    ViewBag.Title = "修改";
    Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
    List<permModel> perm = null;
}

<script type="text/javascript">
    $(function () {

        $("#icon").click(function () {
            //$("#selIcon").toggle();
            window.parent.openIconList();
        });
        $("#selIcon li").click(function () {
            $("#icon").attr("class", $(this).attr("class"));
            $("#Iconic").val($(this).attr("class"));
            $("#selIcon").hide();
        });
        $("#btnSave").click(function () {
            if ($("form").valid()) {
                $.ajax({
                    url: "@Url.Action("Create")",
                    type: "Post",
                    data: $("form").serialize(),
                    dataType: "json",
                    success: function (data) {
                        if (data.type == 1) {
                            window.parent.frameReturnByMes(data.message);
                            window.parent.frameReturnByReload(true);
                            window.parent.frameReturnByClose()
                        }
                        else {
                            window.parent.frameReturnByMes(data.message);
                        }
                    }
                });
            }
            return false;
        });
        $("#btnReturn").click(function () {
            window.parent.frameReturnByClose();
        });
    });

</script>
<div class="mvctool bgb">
    @Html.ToolButton("btnSave", "fa fa-save", Resource.Save,ref perm, "Save", true)
    @Html.ToolButton("btnReturn", "fa fa-reply", Resource.Reply, false)
</div>
@using (Html.BeginForm())
{
    @Html.HiddenFor(model => model.Id)
    @Html.HiddenFor(model => model.CreateTime)
    @Html.HiddenFor(model => model.PATH)
    @Html.HiddenFor(model => model.CreatePerson)
    <table class="formtable">
        <tbody>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Name,0)：
                </th>
                <td>
                    @Html.EditorFor(model => model.Name)
                </td>
            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.EnglishName,0)：
                </th>
                <td>
                    @Html.EditorFor(model => model.EnglishName)
                </td>
            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.ParentId,0)：
                </th>
                <td>
                    @Html.DropDownList("ParentId", new SelectList(ViewBag.Menus, "Id", "Name", Model.ParentId))
                </td>
            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Url,0)：
                </th>
                <td>
                    @Html.EditorFor(model => model.Url)
                </td>
            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Iconic,0)：
                </th>
                <td>
                    @Html.TextBoxFor(model => model.Iconic)
                    @*<input value="fa fa-hand-pointer-o" name="Iconic" id="Iconic"   />*@
                    <div id="icon" title="点我选取图标" style="cursor:pointer" class="fa fa-hand-pointer-o"></div>

                </td>
            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Sort,0)：
                </th>
                <td>
                    @Html.EditorFor(model => model.Sort)
                </td>
            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Remark,0)：
                </th>
                <td>
                    @Html.EditorFor(model => model.Remark)
                </td>
            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Enable,0)：
                </th>
                <td>
                    @Html.RadioFor("Enable", true, "启用", "禁用")
                </td>
            </tr>

            <tr>
                <th>
                    @Html.LabelFor(model => model.IsLast,0)：
                </th>
                <td>
                   @Html.RadiosFor("IsLast", true, new string[] { "true", "false" }, new string[] { "是", "否" })
                </td>
            </tr>

        </tbody>
    </table>
    @Html.ValidationSummary()
}
